public class Test1 {
    public static void func(int a){
//        System.out.println(10/a);
        //case1:方法内部自己处理异常
        try {
            System.out.println(10/a);
        }catch (ArithmeticException e){
            e.printStackTrace();
            System.out.println("a == 0");
        }
    }
    public static void main(String[] args) {
//        func(0);
        //case2:方法的调用者处理异常
        try {
            func(0);
        }catch (ArithmeticException e){
            System.out.println("a == 0");
        }
    }
}
